<?php
require_once("checklogin.php");
require_once("classQuanTriTin.php");
$t = new quantritin;

$tukhoa = $_GET['tukhoa'];


$pageSize = 3;
$pageNum = 1;
if (isset($_GET['pageNum'])==true) $pageNum = $_GET['pageNum'];
if ($pageNum<=0) $pageNum=1;	

$totalRows = 0;
$tin = $t->SearchCustomer_Phone($tukhoa,$pageNum,$pageSize,$lang, $totalRows);

?>
<style>
#ketquatimkiem .caption {
	background-color:#036;
	color:#6FC;
	margin:0px;
	font-size:16px;
	background-image: url(images/label_search_results.jpg);
	background-repeat: no-repeat;
	height: 36px;
	width: 700px;
	display: none;
}
.thongbao {
	font-size: x-large;
	padding-top: 7px;
	padding-bottom: 7px;
	text-align: center;
	color: #333;
}
.tomau {
	font-weight: bolder;
	color: #DD0000;
	font-size: xx-large;
	background-color: #FFB7B7;
	padding-right: 6px;
	padding-left: 6px;
	border: 1px dotted #DD0000;
}
#ketquatimkiem .row_tin {
	min-height:40px;
	margin-top:-1px;
	text-align:justify;
	border-bottom-width: 1px;
	border-bottom-style: dashed;
	border-bottom-color: #79FE76;
	padding-top: 3px;
	padding-right: 1px;
	padding-bottom: 3px;
	padding-left: 5px;
}
#ketquatimkiem .row_tin img {
	margin-right:5px;
	background-color: #DFEFFF;
	border: 1px dashed #B1B1B1;
}
#highlight {
	color: #FF0000;
	font-size: xx-large;
	font-weight: bolder;
}
#ketquatimkiem a{
	text-decoration:none;
	font-size:16px;
	text-transform: capitalize;
	color: #008000;
	font-weight: bold;
}
#ketquatimkiem a:hover {
	text-decoration:underline;
	color:#09FB57;
	font-weight: bold;
}
#ketquatimkiem .theloai {color:#C06;}
#ketquatimkiem .solanxem {
	color:#002E5B;
	font-style: italic;
}
#ketquatimkiem .ngay {
	font-style:italic;
	color:#002E5B
}

.tomau2 {
	color: #1BD700;
	font-size: large;
	background-color: #97FF88;
	padding-right: 6px;
	padding-left: 6px;
	display: block;
	padding-top: 2px;
	padding-bottom: 4px;
	border-top-width: 1px;
	border-bottom-width: 1px;
	border-top-style: dotted;
	border-bottom-style: dotted;
	border-top-color: #05D110;
	border-bottom-color: #05D110;
	margin-top: 20px;
}
.tomau2 a {
	color: #0082BF;
	text-decoration: none;
}
.tomau2 a:hover {
	color: #0091D7;
	text-decoration: none;
}

#thanhphantrang {
	margin: 1px;
	text-align: left;
	padding-left: 30px;
}
#thanhphantrang a  {
	background-color: #fac7da;
	color: #a3d6f3;
	padding-left: 8px;
	padding-right: 8px;
	padding-top: 2px;
	padding-bottom: 2px;
	margin-left: 2px;
	margin-right: 2px;
	text-decoration: none;
}
#thanhphantrang a:hover{
	color: #fac7da;
	text-decoration: underline;
	background-color: #a3d6f3
}  
#thanhphantrang span  {
	background-color: #FFFFFF;
	color: #049bf1;
	padding-left: 3px;
	padding-right: 3px;
	padding-top: 2px;
	padding-bottom: 2px;
	font-weight: bold;
	margin: 0px;
}
#path  {
	color:#FFFFFF;
	padding-top:13px;
	padding-bottom:5px;
	font-weight:bold;
	background-image: url(image/label_long.png);
	background-repeat: no-repeat;
	height: 33px;
	width: 700px;
	padding-left: 10px;
	text-align: left;
}
#path  a {
	text-decoration:none;
	color:#FFFFFF;
}
#path  a:hover {
	text-decoration:none;
	color:#FFFFFF;
	border-bottom-width: 1px;
	border-bottom-style: dotted;
	border-bottom-color: #FFFFFF;
}
</style>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
	$(".row:even").css("background-color","#e8f3f9");
	$(".row:odd").css("background-color", "#fdecf2");
});
</script>
<div id="ketquatimkiem">
<p class="caption">&nbsp;</p>
<?php if($totalRows<=0) {?>
	<p class="thongbao">
    	Không tìm thấy kết quả phù hợp</br>
      <span class="tomau2"><a href="main.php?p=customer_search">Tiếp tục tìm kiếm</a></span>
    </p>
<?php } else { ?>

  <p class="thongbao">Tìm kiếm được <span class="tomau"><?php echo $totalRows?></span> kết quả phù hợp. </p>
    <div id="thanhphantrang" align="right"> 
    <?php echo $t->pagesList($totalRows,$pageNum,$pageSize,5); ?>
  </div>
    
    <?php while ($row_tin = mysql_fetch_assoc($tin) ) {?>
  <?php ob_start(); ?>
  <div class="row_tin">
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td class="row">
                  <p><a href="home.php?p=details&a=search&idTin={idCustomer}">{HoTen}</a>
                </td></tr>
    </table>
        </div>
        <?php 
            $str = ob_get_clean();
            $str = str_replace("{idCustomer}" , $row_tin['idCustomer'] , $str);
            $str = str_replace("{HoTen}" , $row_tin['fullname'] , $str);
            echo $str;
        ?>
    <?php } //while?>
<?php } //if?>
</div> <!-- div ketquatimkiem -->
